bitkeeper revision 1.1159.1.555 (42094892MsTPGiy_x_uFbwMVQuq4Qg)
authoriap10@labyrinth.cl.cam.ac.uk <iap10@labyrinth.cl.cam.ac.uk>
Tue, 8 Feb 2005 23:17:38 +0000 (23:17 +0000)
committeriap10@labyrinth.cl.cam.ac.uk <iap10@labyrinth.cl.cam.ac.uk>
Tue, 8 Feb 2005 23:17:38 +0000 (23:17 +0000)
Fix the synchronization issues between xend and the device model at
startup time.

Initialize the shared page in the hypervisor. Otherwise, the hypervisor
might try to inject spurious interrupts into the guest due to
uninitialized data.

Signed-off-by: Xin B Li <xin.b.li@intel.com>
Signed-off-by: Arun Sharma <arun.sharma@intel.com>
Signed-off-by: ian@xensource.com
tools/ioemu/iodev/main.cc
tools/ioemu/memory/misc_mem.cc
tools/python/xen/xend/XendDomainInfo.py
xen/arch/x86/vmx_vmcs.c

index 763b8b2f7b23497af272dd488d4a945ef7ddca84..c784adb555cb168e332da1340e1e19572cb466af 100644 (file)
@@ -1781,6 +1781,7 @@ int bxmain () {
 // wxWindows under win32.
 int main (int argc, char *argv[])
 {
+  daemon(0, 0);
   bx_startup_flags.argc = argc;
   bx_startup_flags.argv = argv;
 #if BX_WITH_SDL && defined(WIN32)
index a69591dc1db052f370286499fbdbade93889dd7a..5d2b678531f35bb084902b293b4b5ca0cb5fb5c7 100644 (file)
@@ -189,9 +189,6 @@ BX_MEM_C::init_memory(int memsize)
     shared_page = xc_map_foreign_range(xc_handle, domid, PAGE_SIZE, 
                                        PROT_READ|PROT_WRITE, 
                                        page_array[nr_pages - 1]);
-
-    /* Initialize shared page */
-    memset(shared_page, 0, PAGE_SIZE);
 }
 #endif // #if BX_PROVIDE_CPU_MEMORY
 
index 00fb2de04ff1e41a838a335c77c87ef0090de37d..b2a8e6caea1488ade56ad260ff0a39f7bc9ac807 100644 (file)
@@ -855,7 +855,7 @@ class XendDomainInfo:
                       + " -f %s" % device_config
                       + " -d %d" % self.dom
                       + " -p %d" % device_channel['port1']
-                      + " -m %s &" % memory)
+                      + " -m %s" % memory)
         return deferred
 
     def device_create(self, dev_config):
index c75620035fd6b95010303c642d33ca778dc8978b..1d5411bbfae196a4686c69bd3f048e944746e8c9 100644 (file)
@@ -142,6 +142,10 @@ int vmx_setup_platform(struct exec_domain *d, execution_context_t *context)
     mpfn = phys_to_machine_mapping(gpfn);
     p = map_domain_mem(mpfn << PAGE_SHIFT);
     ASSERT(p != NULL);
+
+    /* Initialise shared page */
+    memset(p, 0, PAGE_SIZE);
+
     d->arch.arch_vmx.vmx_platform.shared_page_va = (unsigned long) p;
 
     return 0;